import { difference } from 'lodash'

// 路由懒加载，引入并注册组件
const Home = ()=> import ('@/pages/Home')
const Personal = ()=> import ('@/pages/personal')
const Login = ()=> import ('@/pages/Login')
const Register = ()=> import ('@/pages/Register')
const PhoneLogin = ()=> import ('@/pages/Login/PhoneLogin')
const EmailLogin = ()=> import ('@/pages/Login/EmailLogin')
const Buy = () => import('@/pages/Buy')
const Search = () => import('@/pages/Search')
const Category = ()=> import('@/pages/category')
const GoodsList = ()=> import('@/pages/category/components/goodsList.vue')

const ProductList = () => import('@/pages/Search/ProductList')  //搜索下的详情页
const Detail = () => import('@/pages/Detail')
const Order = () => import('@/pages/Order')
const Pay = () => import('@/pages/Pay')
const Paysuccess = ()=> import('@/pages/Paysuccess')
const Cart = ()=> import('@/pages/Cart')
const PersonalDetailed = () => import('@/pages/personal/PersonalDetailed')
const Test = ()=> import('@/pages/Test')




export default [
  {
    path: '/login',
    component:Login,
    meta:{
      showTabbar:false
    }
  },
  {
    path: '/personal',
    component:Personal,
    meta:{
      showTabbar:true
    }
  },
  {
    path: '/personaldetailed',
    component:PersonalDetailed,
    meta:{
      showTabbar:true
    }
  },
  {
    path: '/home',
    component: Home,
    meta:{
      showTabbar:true
    }
  },
  {
    path: '/cart',
    component: Cart,
    meta:{
      showTabbar:true
    }
  },
  {
    path: '/phonelogin',
    component:PhoneLogin,
    meta:{
      showTabbar:false
    }
  },
  {
    path: '/emaillogin',
    component:EmailLogin,
    meta:{
      showTabbar:false
    }
  },
  {
    name:'buy',
    path: '/buy',
    component: Buy,
    meta: {
      searchType:3,
      showTabbar:true
    }
  },
  {
    path: '/register',
    component:Register,
    meta:{
      showTabbar:false
    }
  },
  {
    name:'search',
    path: '/search',
    component:Search,
    meta:{
      showTabbar:false
    }
  },
  {
    name:'productList',
    path: '/productList',
    component:ProductList,
    meta:{
      showTabbar:false
    }
  },
  {
    name:'detail',
    path: '/detail',
    component:Detail,
    meta:{
      showTabbar:false
    }
  },
  {
    name:'category',
    path: '/category',
    component:Category,
    meta:{
      showTabbar:true
    }
  },
  {
    name:'goodsList',
    path: '/goodsList',
    component:GoodsList,
    meta:{
      showTabbar:false
    }
  },

  {
    name:'order',
    path: '/order',
    component: Order,
  },
  {
    name:'pay',
    path: '/pay',
    component: Pay,
  },
  {
    name:'paysuccess',
    path: '/paysuccess',
    component: Paysuccess,
  },
  {

    name:'test',
    path: '/test',
    component: Test,
    meta:{
      showTabbar:true
    },

    path: '*',
    name: 'err404',
    component: () => import('../components/Err404')

  },
 
  {
    path: '/',
    redirect:'/Home'
  }
]
